/* ===================

AX2E (AXESCON XACML 2.0 Engine) is the Java authorization engine, which implements OASIS XACML 2.0 standard.
Copyright (C) 2007 AXESCON LLC

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA


Contact: AXESCON LLC - info{at}axescon.com

 =================== */
/*
 * XML Type:  Policy
 * Namespace: urn:oasis:names:tc:xacml:2.0:policy:schema:os
 * Java type: Policy
 *
 * Automatically generated - do not modify.
 */
package axescon.xacml.model.policy;

import axescon.xacml.api.CtxHandler;
import axescon.xacml.api.PolicyEvaluator;
import axescon.xacml.api.XacmlException;
import axescon.xacml.model.ctx.Result;
import axescon.xacml.model.ctx.XacmlCtx;

import java.util.Map;


/**
 * @author argyn
 *         Date: Oct 12, 2005
 *         Responsibilities: generic interface of Policy and PolicySet objects in XACML Policy schema.
 */
public interface PolicyObject extends PolicyProxy {


    /**
     * Gets the "Description" element
     */
    String getDescription();

    /**
     * True if has "Description" element
     */
    boolean isSetDescription();

    /**
     * Sets the "Description" element
     */
    void setDescription(String description);

    /**
     * Unsets the "Description" element
     */
    void unsetDescription();

    /**
     * Gets the "PolicyDefaults" element
     */
    Defaults getDefaults();

    /**
     * True if has "PolicyDefaults" element
     */
    boolean isSetDefaults();

    /**
     * Sets the "PolicyDefaults" element
     */
    void setDefaults(Defaults policyDefaults);

    /**
     * Unsets the "PolicyDefaults" element
     */
    void unsetDefaults();

    /**
     * Gets a List of "CombinerParameters" elements
     */
    CombinerParameters[] getCombinerParametersArray();

    /**
     * Gets the "Target" element
     */
    Target getTarget();

    /**
     * Sets the "Target" element
     */
    void setTarget(Target target);


    /**
     * Gets a List of "Obligation" elements
     */
    Obligation[] getObligationArray();


    /**
     * True if has "Version" attribute
     */
    boolean isSetVersion();

    /**
     * Sets the "Version" attribute
     */
    void setVersion(String version);

    /**
     * Unsets the "Version" attribute
     */
    void unsetVersion();

    /**
     * Gets the "RuleCombiningAlgId" attribute
     */
    String getRuleCombiningAlgId();

    /**
     * Sets the "RuleCombiningAlgId" attribute
     */
    void setRuleCombiningAlgId(String ruleCombiningAlgId);

    /**
     * evaluates this object, assuming that its target matches request
     * @param pe policy eveluator
     * @param req request
     * @param ch context handler
     * @return XACML Context Result of evaluation of this policy object
     * @throws XacmlException
     */
    public Result evalMatched(PolicyEvaluator pe, XacmlCtx req, CtxHandler ch) throws XacmlException;

    /**
     * sets the namespace declarations used in xpath
     *
     * @param namespaces map of all namespaces
     */
    void setNamespacesDecls(Map namespaces);

    /**
     * @return something like "declare namespace foo='bar'; declare namespace foo2='bar2'; ...";
     */
    String getNamespacesDecls();

    /**
     * set the root PolicyObject in the XML document, which contains this policy object
     * @param rootPolicyObject
     */
    public void setRootPolicyObject(PolicyObject rootPolicyObject);
}
